<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<div class="form-edit-task">

<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<?php endif;?>

<span>渠道：</span> <select name="channel_id" id="channel_id" onChange="if(value!=''){window.location.href=this.options[this.selectedIndex].value;}else{return(false);}">
	<option value="0">渠道页</option>
	<?php if($this->channels):?>
	<?php foreach($this->channels as $channel_id=>$channel_info):?>
		<option value="/bk/homepage-banners/channel_id/<?=$channel_id?>" <?php if($channel_id==$this->channel_id){echo "selected='selected'";}?>><?=$channel_info['channel_name']?></option>
	<?php endforeach;?>
	<?php endif;?>
</select>
<br/><br/><br/>

<form action="/bk/homepage-banners-submit" method="post" name="form1" enctype="multipart/form-data" onsubmit="return submitform(this)">
<?php $n=1;?>
<?php foreach ($this->banners as $bid=>$bval):?>
<span>图<?=$n?>：</span><input type="file" name="image_<?=$bid?>" />&nbsp;&nbsp;(720x274)&nbsp;&nbsp;链接<?=$n?>：<input type="text" name="url_<?=$bid?>" value="<?=$bval['target_url']?>" /><br/>
<?php if($bval['image_url']):?>
<a href="/images/banners/<?=$bval['image_url']?>" target="_blank"><img src="/images/banners/<?=$bval['image_url']?>" border="0" height="30" /></a>&nbsp;&nbsp;<a href="/bk/homepage-banners-del/id/<?=$bid?>">删除</a><br /><br />
<?php endif;?>
<?php $n += 1;?>
<?php endforeach;?>
<input type="hidden" name="channel_id" value="<?=$this->channel_id?>" />
<input type="submit" class="buttonlong" value="确认" />
<br /><br />
</form>
</div>
</div>

<script>
function submitform() 
{
	form1.submit();
}
</script>